from django.shortcuts import render, HttpResponse
from app01.utils.bootstrap import BootstrapForm
from django import forms


class UpForm(BootstrapForm):
    name = forms.CharField(label="姓名")
    age = forms.IntegerField(label="年龄")
    img = forms.FileField(label="头像")


def upload_form(request):
    """ 上传图片 """

    title = "Form上传"
    form = UpForm()

    return render(request, 'upload_form.html', {"form": form, "title": title})
